package com.guoxue.util;

import javax.annotation.PostConstruct;
import javax.persistence.PostLoad;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;

import com.sun.org.glassfish.gmbal.ParameterNames;

@SuppressWarnings("deprecation")
public class WebStartUtil implements ServletContextListener{
	@PostConstruct
	@Override
	public void contextInitialized(ServletContextEvent sce) {
		
		 Configuration cfg = new AnnotationConfiguration().configure("/hibernate.cfg.xml");  
	     cfg.buildSessionFactory();
		 System.out.println("web启动初始化");
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		
	}

}
